#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QMenuBar* bar = new QMenuBar();
    this->setMenuBar(bar);

    QMenu* menu1 = new QMenu("menu1");
    bar->addMenu(menu1);
    QAction* action1_1 = new QAction("action1_1");
    QAction* action1_2 = new QAction("action1_2");
    QAction* action1_3 = new QAction("action1_3");
    QAction* action1_4 = new QAction("action1_4");
    menu1->addAction(action1_1);
    menu1->addAction(action1_2);
    menu1->addAction(action1_3);
    menu1->addAction(action1_4);

    QMenu* menu2 = new QMenu("menu2");
    QAction* action2_1 = new QAction("action2_1");
    QAction* action2_2 = new QAction("action2_2");
    QAction* action2_3 = new QAction("action2_3");
    QAction* action2_4 = new QAction("action2_4");
    menu1->addMenu(menu2);
    menu2->addAction(action2_1);
    menu2->addAction(action2_2);
    menu2->addAction(action2_3);
    menu2->addAction(action2_4);
}

MainWindow::~MainWindow()
{
    delete ui;
}

